package com.auxgroup.smarthome.business.service.inner;

import com.auxgroup.bridge.business.inner.vo.AppIndexPageVo;
import com.auxgroup.bridge.business.inner.vo.CurrentAppIndexPageVo;
import com.auxgroup.smarthome.business.service.DeviceFaultInnerServiceFallback;
import com.auxgroup.smarthome.web.ApiResponse;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * app首页管理
 * @Author: laiqiuhua.
 * @Date: 2017/9/8 16:06.
 */
@FeignClient(name="INNER-SERVICE", fallback = DeviceFaultInnerServiceFallback.class)
public interface AppIndexPageInnerService  {
    @PostMapping("/inner/index_page/save")
    ApiResponse<AppIndexPageVo> saveAppIndexPage(@RequestParam("zipUri") String zipUri, @RequestParam("htmlUri") String htmlUri);

    @PostMapping(value = "/inner/index_page/relese")
    ApiResponse<AppIndexPageVo> publish(@RequestParam("indexPageId") String indexPageId, @RequestParam(value = "releseUser", required = false) String releseUser);

    @GetMapping(value = "/inner/index_page/history")
    ApiResponse<List<AppIndexPageVo>> findVersionHistory();

    @GetMapping(value = "/inner/index_page/current_version")
    ApiResponse<AppIndexPageVo> getlatestIndexPage();

    @GetMapping(value = "/inner/index_page/current_web_version")
    ApiResponse<CurrentAppIndexPageVo> getlatestIndexPageVersion();

}
